package com.zpark.controller;

import com.zpark.entity.patients.PatientInfo;
import com.zpark.service.PatientInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/patients")
public class PatientInfoController {

    @Autowired
    private PatientInfoService patientInfoService;

    @GetMapping("/all")
    public List<PatientInfo> getAllPatients() {
        return patientInfoService.list();
    }
}